package pub.tbc.mybatis.assist.plugin.page;

import lombok.Data;
import lombok.extern.slf4j.Slf4j;

import java.util.List;

/**
 * @author tbc on 2017/5/16 13:03:29.
 */
@Slf4j
@Data
public class PageWrapper {
    /**
     * 当前面码
     */
    private Integer pageNum;
    /**
     * 每页条数
     */
    private Integer pageSize;
    /**
     * 当前SQL返回总数
     */
    private Integer total;
    /**
     * 总页数
     */
    private Integer totalPage;
    /**
     * 获取到的数据
     */
    private List<?> data;

    public PageWrapper(PageParams pageParams, List<?> data) {
        this.pageNum = pageParams.getPageNum();
        this.pageSize = pageParams.getPageSize();
        this.total = pageParams.getTotal();
        this.totalPage = pageParams.getTotalPage();
        this.data = data;
    }


}
